package Properties;

import java.util.Random;
import java.util.Scanner;

public class GuessNumber {
    private GuessNumber(){

    }
    public  static void start(){
        Random r = new Random();
        int num = r.nextInt(100)+1;
        while (true){
            Scanner sc = new Scanner(System.in);
            System.out.println("请输入你猜的数字");
            int guessNUmber = sc.nextInt();
            if(guessNUmber>num){
                System.out.println("你猜的数字"+guessNUmber+"大了");
            }else if(guessNUmber<num){
                System.out.println("你猜的数字"+guessNUmber+"小了");
            }else {
                System.out.println("恭喜你猜对了");
                break;
            }
        }
    }
}
